﻿using System;
using UnityEngine;

namespace SoarD.Pandora
{
    public class LogFile
    {
        private static string PdrLogPath { get { return Application.dataPath.Replace("/Assets", "/PdrLogs"); } }
        public static void WriteLog(string title, string content)
        {
            var date = DateTime.Now.ToString("yyyyMMdd_HHmmss");
            string fileName = date;
            if (!string.IsNullOrEmpty(title))
            {
                fileName = string.Format("{0}_[{1}]", date, title);
            }
            fileName = fileName + ".txt";
            PdrFileUtil.SaveTextToFile(PdrLogPath, fileName, content);
        }

        public static void OpenLogRoot()
        {
            PdrFileUtil.OpenFolder(PdrLogPath);
        }

        public static void ClearAllLogs()
        {

        }
    }

}
